package com.wceManage.commons.convert;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * ConvertUtils
 */
public final class ConvertBeanUtils {

	public static <T> T convertJsonToBean(JSON json, Class<T> clasz) {
		return JSONObject.toJavaObject(json, clasz);
	}

	public static <T> List<T> convertJsonToList(String jsonString, Class cls) {
		List<T> list = new ArrayList<T>();
		try {
			list = JSON.parseArray(jsonString, cls);
		} catch (Exception e) {
		}
		return list;
	}
}
